//api文件仍保留但不建议使用，推荐使用models中的api。API files remain preserved (deprecated), use models APIs instead.
import type { Codelabs, CodelabsResponse } from './types.js';

import { requestClient } from '#/api/request';

export const getuctooCodelabsList = async (page: number, pageSize: number,
  searchParams?: any) => {
  return requestClient.get<CodelabsResponse>(`/uctoo/codelabs/${pageSize}/${page}`,{
    params: searchParams,
  });
};

export const getuctooCodelabs = async (id: string) => {
  return requestClient.get<Codelabs>(`/uctoo/codelabs/${id}`);
};

export const adductooCodelabs = async (data: Partial<Codelabs>) => {
  return requestClient.post<Codelabs>('/uctoo/codelabs/add', data);
};

export const edituctooCodelabs = async (data: Partial<Codelabs>) => {
  return requestClient.post<Codelabs>('/uctoo/codelabs/edit', data);
};

export const deleteuctooCodelabs = async (id: string) => {
  return requestClient.post<any>('/uctoo/codelabs/del', { id });
};
